<template>
  <div class="custom-form">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
        :key="showFormKey">
        <!-- 项目变更申请 -->
        <el-col :span="24">
          <el-form-item label-width="0" prop="field100726c">
            <h2 align='center' style="color:undefined;font-size: nullpx;text-align: center">项目变更申请</h2>
          </el-form-item>
        </el-col>
        <!-- 当前用户 -->
        <el-col :span="24" v-if="hasFormPermission('current_user_id')" v-show="false">
          <el-form-item :label="$t('当前用户')" prop="current_user_id">
            <avue-information-body :operationVal="operationVal" infoType='user'
              :whetherToRebindSecondaryEditing='false' v-model="formData['current_user_id']"
              placeholder="当前用户" :disabled="hasDisabledPermission('current_user_id',true)"
              :readonly="!hasEditPermission('current_user_id',true)" :style="{width: '100%'}">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <!-- 职级名称 -->
        <el-col :span="24" v-if="hasFormPermission('job')" v-show="false">
          <el-form-item :label="$t('职级名称')" prop="job">
            <el-input v-model="formData['job']" placeholder="请输入职级名称"
              :disabled="hasDisabledPermission('job',false)"
              :readonly="!hasEditPermission('job',false)" clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 角色ID -->
        <el-col :span="24" v-if="hasFormPermission('role_id')" v-show="false">
          <el-form-item :label="$t('角色ID')" prop="role_id">
            <el-input v-model="formData['role_id']" placeholder="请输入角色ID"
              :disabled="hasDisabledPermission('role_id',false)"
              :readonly="!hasEditPermission('role_id',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 角色名称 -->
        <el-col :span="24" v-if="hasFormPermission('role_name')" v-show="false">
          <el-form-item :label="$t('角色名称')" prop="role_name">
            <el-input v-model="formData['role_name']" placeholder="请输入角色名称"
              :disabled="hasDisabledPermission('role_name',false)"
              :readonly="!hasEditPermission('role_name',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 地区 -->
        <el-col :span="24" v-if="hasFormPermission('area')" v-show="false">
          <el-form-item :label="$t('地区')" prop="area">
            <el-input v-model="formData['area']" placeholder="请输入地区"
              :disabled="hasDisabledPermission('area',false)"
              :readonly="!hasEditPermission('area',false)" clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 申请人ID -->
        <el-col :span="24" v-if="hasFormPermission('user_id')" v-show="false">
          <el-form-item :label="$t('申请人ID')" prop="user_id">
            <el-input v-model="formData['user_id']" placeholder="请输入申请人ID"
              :disabled="hasDisabledPermission('user_id',false)"
              :readonly="!hasEditPermission('user_id',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 申请人名称 -->
        <el-col :span="24" v-if="hasFormPermission('user_name')">
          <el-form-item :label="$t('申请人名称')" prop="user_name">
            <el-input v-model="formData['user_name']" placeholder="请输入申请人名称"
              :disabled="hasDisabledPermission('user_name',false)"
              :readonly="true" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 申请时间 -->
        <el-col :span="24" v-if="hasFormPermission('apply_time')" v-show="false">
          <el-form-item :label="$t('申请时间')" prop="apply_time">
            <avue-information-body :operationVal="operationVal" infoType='date'
              :whetherToRebindSecondaryEditing='false' v-model="formData['apply_time']" placeholder="当前公司申请时间"
              :disabled="hasDisabledPermission('apply_time',true)"
              :readonly="!hasEditPermission('apply_time',true)" :style="{width: '100%'}">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <!-- 部门简称 -->
        <el-col :span="24" v-if="hasFormPermission('depart_short_name')" v-show="false">
          <el-form-item :label="$t('部门简称')" prop="depart_short_name">
            <el-input v-model="formData['depart_short_name']" placeholder="请输入部门简称"
              :disabled="hasDisabledPermission('depart_short_name',false)"
              :readonly="!hasEditPermission('depart_short_name',false)" clearable
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 部门ID -->
        <el-col :span="24" v-if="hasFormPermission('depart_id')">
          <el-form-item :label="$t('部门')" prop="depart_id">
            <el-select v-model="formData['depart_id']" placeholder="请选择部门ID"
              :disabled="hasDisabledPermission('depart_id',false)" filterable clearable
              @change="Handleselect"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in depart_idOptions" :key="index" :label="item.F_ShortName"
                :value="item.F_DepartmentId" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 是否生效 -->
        <el-col :span="24" v-if="hasFormPermission('is_effective')" v-show="false">
          <el-form-item :label="$t('是否生效')" prop="is_effective">
            <el-input v-model="formData['is_effective']" placeholder="请输入是否生效"
              :disabled="hasDisabledPermission('is_effective',false)"
              :readonly="!hasEditPermission('is_effective',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 变更发起部门 -->
        <el-col :span="24" v-if="hasFormPermission('select_depart')">
          <el-form-item :label="$t('变更发起部门')" prop="select_depart">
            <!-- <avue-input-tree v-model="formData['select_depart']"
              :disabled="hasDisabledPermission('select_depart',false)" placeholder="系统默认(公司)变更发起部门"
              type="tree" :dic="select_departOptions" :style="{width: '100%'}"></avue-input-tree> -->
              <SelectOnlyDepartment @sendData="sendData1" />
          </el-form-item>
        </el-col>
        <!-- 其他说明 -->
        <el-col :span="24" v-if="hasFormPermission('select_depart_des')">
          <el-form-item :label="$t('其他说明')" prop="select_depart_des">
            <el-input v-model="formData['select_depart_des']" type="textarea" placeholder="请输入其他说明"
              :disabled="hasDisabledPermission('select_depart_des',false)"
              :readonly="!hasEditPermission('select_depart_des',false)"
              :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 部门/中心名称 -->
        <el-col :span="24" v-if="hasFormPermission('input_depart')">
          <el-form-item :label="$t('部门/中心名称')" prop="input_depart">
            <el-input v-model="formData['input_depart']" placeholder="输入请请详细填写部门/中心名称"
              :disabled="hasDisabledPermission('input_depart',false)"
              :readonly="!hasEditPermission('input_depart',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 请选择立项/技术方案协议等文件审批单 -->
        <el-col :span="24" v-if="hasFormPermission('project_technology_protocol')">
          <el-form-item :label="$t('立项/技术方案')" prop="project_technology_protocol">
            <el-input v-model="formData['project_technology_protocol']" placeholder="输入请请选择立项/技术方案协议等文件审批单"
              :disabled="hasDisabledPermission('project_technology_protocol',false)"
              @focus="selectApprovalForm"
              :readonly="!hasEditPermission('project_technology_protocol',false)" clearable
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 关联审批单 -->
        <el-col :span="24" v-show="selectData.length > 0">
          <el-form-item label="">
            <div class="del_items" v-for="(item,index) in selectData" :key="index">
              <div class="del-items-left"><img src="../../../assets/card/file.png"></div>
              <div class="del-items-middle">{{item.startUser}}提交的{{item.schemeName}}</div>
              <div class="del-items-refuse" v-if="item.status==0">审批拒绝</div>
              <div class="del-items-adopt" v-else-if="item.status==1">审批通过</div>
              <div class="del-items-processing" v-else>审批中</div>
              <div class="del-items-close" @click="delApproval(item,index)"><img src="../../../assets/card/close.png"></div>
            </div>
          </el-form-item>
        </el-col>
        <!-- 变更明细 -->
        <!--
            ①项目内容:变更内容
            ②资金需求：资金需求
            ③工期延迟：工期延迟
            ④人员变更：人员变更资料
            ⑤其他：其他
        -->
        <el-col :span="24" v-if="hasFormPermission('change_detail')">
          <el-form-item :label="$t('变更明细')" prop="change_detail">
            <el-select v-model="formData['change_detail']" placeholder="请选择变更明细"
              :disabled="hasDisabledPermission('change_detail',false)" multiple filterable clearable
              @change="selectChangeDetails"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in change_detailOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <!-- 变更内容 -->
        <el-col :span="24" v-if="hasFormPermission('change_content') && formData['change_detail'].includes('1')">
          <el-form-item :label="$t('变更内容')" prop="change_content">
            <el-input v-model="formData['change_content']" type="textarea" placeholder="请输入变更内容"
              :disabled="hasDisabledPermission('change_content',false)"
              :readonly="!hasEditPermission('change_content',false)" :autosize="{minRows: 4, maxRows: 4}"
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 资金需求 -->
        <el-col :span="24" v-if="hasFormPermission('money_need') && formData['change_detail'].includes('2')">
          <el-form-item :label="$t('资金需求')" prop="money_need">
            <el-input v-model="formData['money_need']" type="number" placeholder="请输入资金需求"
              :disabled="hasDisabledPermission('money_need',false)"
              :readonly="!hasEditPermission('money_need',false)" clearable :style="{width: '100%'}">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 预计工期 -->
        <el-col :span="24" v-if="hasFormPermission('project_time') && formData['change_detail'].includes('3')">
          <el-form-item :label="$t('预计工期')" prop="project_time">
            <el-input v-model="formData['project_time']" type="number" placeholder="请输入预计工期"
              :disabled="hasDisabledPermission('project_time',false)"
              :readonly="!hasEditPermission('project_time',false)" clearable :style="{width: '100%'}">
              <template slot="append">天</template>
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 人员变更资料 -->
        <el-col :span="24" v-if="hasFormPermission('change_person_url') && formData['change_detail'].includes('4')">
          <el-form-item :label="$t('人员变更资料')" prop="change_person_url">
            <xjr-custom-upload :config="change_person_urlConfig"
              :disabled="hasDisabledPermission('change_person_url',false)"
              v-model="formData['change_person_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <!-- 其他说明 -->
        <el-col :span="24" v-if="hasFormPermission('change_person_des') && formData['change_detail'].includes('5')">
          <el-form-item :label="$t('其他说明')" prop="change_person_des">
            <el-input v-model="formData['change_person_des']" type="textarea" placeholder="请输入其他说明"
              :disabled="hasDisabledPermission('change_person_des',false)"
              :readonly="!hasEditPermission('change_person_des',false)"
              :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 是否需要变更资料 -->
        <el-col :span="24" v-if="hasFormPermission('is_change_data')">
          <el-form-item :label="$t('变更资料')" prop="is_change_data">
            <el-select v-model="formData['is_change_data']" placeholder="请选择是否需要变更资料"
              :disabled="hasDisabledPermission('is_change_data',false)" filterable clearable
              @change="selectChangeData"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in is_change_dataOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 变更资料及其他附件 -->
        <el-col :span="24" v-if="hasFormPermission('change_data_url')" v-show="flagData">
          <el-form-item :label="$t('变更资料/附件')" prop="change_data_url">
            <xjr-custom-upload :config="change_data_urlConfig"
              :disabled="hasDisabledPermission('change_data_url',false)"
              v-model="formData['change_data_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="0" prop="field129bca1">
            <div style="border-top: 1px solid #dcdfe6;margin-top: 0px;margin-bottom: 0px;"></div>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasWorkFlowFormPermission('field130326e')" v-show="optionsFlag">
          <el-form-item :label="$t('意见簿')" prop="field130326e">
            <xjr-opinion-comonent :value="formData.field130326e"></xjr-opinion-comonent>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="!isWorkflowForm">
          <el-form-item size="large" v-if="isEdit">
            <el-button type="primary" @click="submitForm" :loading="submitLoading">
              {{submitLoading?$t('workFlow.WFMenu.hintSubmit'):$t('submit')}}</el-button>
            <el-button @click="cancelForm">{{$t('cancelText')}}</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <!-- 关联审批单 -->
    <el-dialog
      append-to-body	
      title="关联审批单"
      :visible.sync="approvalFormVisible"
      width="880px"
      :before-close="handleClose">
      <Approval1 ref='approval'/>
      <span slot="footer" class="dialog-footer">
        <div class="height16"></div>
        <el-button @click="approvalFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="sure">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>

  import FilterableDataList from '@/components/generator/clientComponents/FilterableDataList.vue';
  import workflowFormAuthorize from "@/mixins/workflowFormAuthorize";
  import authorizeMixin from "@/mixins/authorize";
  import { baseUrl } from "@/config/env";
  import SelectOnlyDepartment from '@/components/staffSelector/selectOnlyDepartment.vue'
  import {getUserDetailsById} from '@/api/user.js';
  import Approval1 from '../components/approval1.vue'
  import request from "@/router/axios";
  export default {
    mixins: [authorizeMixin,workflowFormAuthorize],
    components: {Approval1,SelectOnlyDepartment},
    props: ['keyValue', 'isEdit', 'disabled'],
    data() {
      let _this = this
      return {
        submitLoading: false,
        showForm: true,
        showFormKey: 1,
        reRenderSubform: false,
        operationVal: 'add',
        isAdd: true,
        addressUrl:'projectchange',
        mainTableName: 'oa_project_change',
        formConfig: {},
        formData: {
          'field100726c': '',
          'current_user_id': '',
          'job': '',
          'role_id': '',
          'role_name': '',
          'area': '',
          'user_id': '',
          'user_name': '',
          'apply_time': '',
          'depart_short_name': '',
          'depart_id': '',
          'is_effective': "0",
          'select_depart_short_name': '',
          'select_depart': '',
          'select_depart_des': '',
          'input_depart': '',
          'project_technology_protocol': '',
          'change_detail': [],
          'change_content': '',
          'money_need': "",
          'project_time': "",
          'change_person_url': null,
          'change_person_des': '',
          'is_change_data': '',
          'change_data_url': null,
          'field129bca1': '',
          'field130326e': null,
        },
        rules: {
          job: [{
            required: true,
            message: '请输入职级名称',
            trigger: 'blur'
          }],
          role_id: [{
            required: true,
            message: '请输入角色ID',
            trigger: 'blur'
          }],
          role_name: [{
            required: true,
            message: '请输入角色名称',
            trigger: 'blur'
          }],
          area: [{
            required: true,
            message: '请输入地区',
            trigger: 'blur'
          }],
          user_id: [{
            required: true,
            message: '请输入申请人ID',
            trigger: 'blur'
          }],
          user_name: [{
            required: true,
            message: '请输入申请人名称',
            trigger: 'blur'
          }],
          depart_short_name: [{
            required: true,
            message: '请输入部门简称',
            trigger: 'blur'
          }],
          depart_id: [{
            required: true,
            message: '请选择部门ID',
            trigger: 'change'
          }],
          is_effective: [{
            required: true,
            message: '请输入是否生效',
            trigger: 'blur'
          }],
          select_depart: [],
          select_depart_des: [{
            required: true,
            message: '请输入其他说明',
            trigger: 'blur'
          }],
          input_depart: [{
            required: true,
            message: '输入请请详细填写部门/中心名称',
            trigger: 'blur'
          }],
          project_technology_protocol: [{
            required: true,
            message: '输入请请选择立项/技术方案协议等文件审批单',
            trigger: 'change'
          }],
          change_detail: [{
            required: true,
            message: '请选择变更明细',
            trigger: 'change'
          }],
          change_content: [{
            required: false,
            message: '请输入变更内容',
            trigger: 'blur'
          }],
          money_need: [{
            required: false,
            message: '请输入资金需求',
            trigger: 'blur'
          }],
          project_time: [{
            required: false,
            message: '请输入预计工期',
            trigger: 'blur'
          }],
          change_person_url: [{
            required: false,
            message: '人员变更资料不能为空',
            trigger: 'change'
          }],
          change_person_des: [{
            required: false,
            message: '请输入其他说明',
            trigger: 'blur'
          }],
          is_change_data: [{
            required: true,
            message: '请选择是否需要变更资料',
            trigger: 'change'
          }],
          change_data_url: [{
            required: false,
            message: '变更资料及其他附件不能为空',
            trigger: 'change'
          }],
        },
        depart_idOptions: [],
        select_departOptions: undefined,
        change_detailOptions: [],
        change_person_urlConfig: {
          "showTip": false,
          "fileSize": 2,
          "sizeUnit": "MB",
          "buttonText": "点击上传",
          "disabled": false
        },
        is_change_dataOptions: [],
        change_data_urlConfig: {
          "showTip": false,
          "fileSize": 2,
          "sizeUnit": "MB",
          "buttonText": "点击上传",
          "disabled": false
        },
        flagData:false,
        approvalFormVisible:false,
        selectData:[],
      }
    },
    computed: {},
    watch: {
      'formData.money_need': function(val, oldVal) {
        this.changeFormConfigDefaultValue();
      },
      'formData.project_time': function(val, oldVal) {
        this.changeFormConfigDefaultValue();
      },
    },
    created() {
      this.formConfig = this.getFormConfig();
    },
    async mounted() {
      //TODO   再这里做数据回填 请求表单数据
    
      if(this.keyValue){
          this.isAdd = false;
      }
      if(!this.isAdd&&this.keyValue){
          this.operationVal = 'edit';
          try {
            let res = await request({
              url: baseUrl + "/"+this.addressUrl+"/" + this.keyValue,
              method: "get",
            });
              
        this.formData = res.data.data
        
              this.showFormKey++;
          } catch (error) {
          }
      }
      if (typeof this.getSelect_departOptions == "function") {
        await this.getSelect_departOptions();
      }
      if (typeof this.getChange_detailOptions == "function") {
        await this.getChange_detailOptions();
      }
      if (typeof this.getIs_change_dataOptions == "function") {
        await this.getIs_change_dataOptions();
      }
      setTimeout(() => {
        this.getUserInfo()
      }, 500);
    },
    methods: {
      selectChangeData(){
        if(this.formData['is_change_data'] == 1){
          this.flagData = true
        }else{
          this.flagData = false
        }
      },
      selectApprovalForm(){
        this.approvalFormVisible = true
        this.$nextTick(()=>{
          this.$refs.approval.init()
        })
      },
      sure(v){
        if(v=='del'){
          this.formData['project_technology_protocol'] = ''
        }
        this.$refs.approval.historyTaskData = this.$refs.approval.historyTaskData.filter(e => e.isChecked)
        this.$refs.approval.myTaskData = this.$refs.approval.myTaskData.filter(e => e.isChecked)
        this.$refs.approval.manualTaskData = this.$refs.approval.manualTaskData.filter(e => e.isChecked)
        if(this.$refs.approval.historyTaskData && this.$refs.approval.historyTaskData.length > 0){
          this.$refs.approval.historyTaskData.forEach(element => {
            this.formData['project_technology_protocol'] += element.processInstanceId + ','
          })
        }
        if(this.$refs.approval.myTaskData && this.$refs.approval.myTaskData.length > 0){
          this.$refs.approval.myTaskData.forEach(element => {
            this.formData['project_technology_protocol'] += element.processInstanceId + ','
          })
        }
        if(this.$refs.approval.manualTaskData && this.$refs.approval.manualTaskData.length > 0){
          this.$refs.approval.manualTaskData.forEach(element => {
            this.formData['project_technology_protocol'] += element.processInstanceId + ','
          })
        }
        this.selectData = [...this.$refs.approval.historyTaskData,...this.$refs.approval.myTaskData,...this.$refs.approval.manualTaskData]
        this.approvalFormVisible = false
      },
      delApproval(item,index){
        if(this.$refs.approval.historyTaskData.includes(item)){
          this.$refs.approval.historyTaskData.forEach((e,i) => {
            if(e == item){
              this.$refs.approval.historyTaskData.splice(i,1)
            }
          })
        }
        if(this.$refs.approval.myTaskData.includes(item)){
          this.$refs.approval.myTaskData.forEach((e,i) => {
            if(e == item){
              this.$refs.approval.myTaskData.splice(i,1)
            }
          })
        }
        if(this.$refs.approval.manualTaskData.includes(item)){
          this.$refs.approval.manualTaskData.forEach((e,i) => {
            if(e == item){
              this.$refs.approval.manualTaskData.splice(i,1)
            }
          })
        }
        this.sure('del')
      },
      getUserInfo(){
          let params = {
            userId:this.formData.current_user_id
          }
          getUserDetailsById(params).then(res => {
            if(res.data.success){
              this.formData['job'] = res.data.data.F_Job
              this.formData['area'] = res.data.data.F_Area
              this.formData['user_id'] = this.formData.current_user_id
              this.formData['user_name'] = res.data.data.F_RealName
              this.depart_idOptions = res.data.data.F_Department
              this.roleData = res.data.data.F_Role
              this.initRole()
              this.initDepartmentData()
            }
          })
      },
      initDepartmentData(){
        if(this.depart_idOptions && this.depart_idOptions.length == 1){
          this.formData['depart_short_name'] = this.depart_idOptions[0].F_FullName
          this.formData['depart_id'] = this.depart_idOptions[0].F_DepartmentId
        }
      },
      Handleselect(){
        if(this.depart_idOptions && this.depart_idOptions.length > 0){
          this.depart_idOptions.forEach(e => {
            if(e.F_DepartmentId == this.formData['depart_id']){
              this.formData['depart_short_name'] = e.F_ShortName
            }
          })
        }
      },
      initRole(){
          let roleId = []
          let roleName = []
          if(this.roleData && this.roleData.length > 0){
            this.roleData.forEach(e => {
              roleId.push(e.F_RoleId)
              roleName.push(e.F_FullName)
            })
          }
          this.formData['role_id'] = roleId.join(',')
          this.formData['role_name'] = roleName.join(',')
      },
      getFormData() {
        let key = this.mainTableName + 'Entity';
        let returnParams = {};
        returnParams[key] = this.formData;
        return {
          ...returnParams,
        };
      },
      validateForm() {
        this.$refs['elForm'].validate(valid => {});
      },
      async aysncValidateForm() {
        let validataArry = []
        validataArry.push(new Promise((resolve, reject) => {
          this.$refs['elForm'].validate(valid => {
            resolve(valid)
          })
        }))
        let res = await Promise.all(validataArry)
        if (res.includes(false)) {
          return false
        }
        else {
          return true;
        }
      },
      changeTableData() {},
      async submitForm() {
        this.submitLoading = true;
        let valid = await this.aysncValidateForm();
        if (valid == false) {
          this.submitLoading = false;
          return false;
        }
        this.changeTableData();
        //格式化数据
        let newObj = this.getFormData();
        
          //如果没有传入参数就是新增
          if (!this.keyValue) {

            request({
              url: baseUrl + "/"+this.addressUrl,
              method: "post",
              data : newObj
            }).then((res) => {
              this.submitLoading = false;
              this.$notify({
                title: "成功",
                message: "新增成功",
                type: "success",
              });
              this.$emit("onChange",true)
            });

          }
          else{

          request({
              url: baseUrl + "/"+this.addressUrl+"/" + this.keyValue,
              method: "put",
              data : newObj
            }).then((res) => {
              this.submitLoading = false;
              this.$notify({
                title: "成功",
                message: "修改成功",
                type: "success",
              });
              this.$emit("onChange",true)
            });

          }
        
        
        
      },
      cancelForm() {
        this.$emit("onChange", true)
      },
      formatTree(data, valueField, lableField, childField, type) {
        let tree = [];
        data.forEach((node, index) => {
          let newNode = {
            value: node[valueField],
            label: node[lableField],
          };
          if (type) {
            newNode.disabled = node[valueField] == undefined ? true : false
          }
          tree.push(newNode);
          if (node[childField] != null && node[childField].length > 0) {
            newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
            type));
          }
        }, this);
        return tree;
      },
      //辅助工作流 审批(编辑) 预留方法
      handleEdit() {
      },
      sendData1(value){
        this.formData['select_depart'] = value
      },
      getNumberFixed2(number) {
        let splitNum = ("" + number).replace(/(^0*)/g, "").split(".");
        let num = splitNum[0] == "" ? '0' : splitNum[0];
        if (splitNum.length > 1) {
          num += '.';
          let roundNum = 2; //保留两位小数
          for (let i = 0; i < roundNum; i++) {
            num += splitNum[1][i];
          }
        }
        return parseFloat(num);
      },
      changeFormConfigDefaultValue() {
        let valueForFormIdMap = new Map();
        this.formConfig.fields.forEach((ele) => {
          if (ele.__config__.componentName == "table") {
            ele.__config__.children.forEach((element) => {
              valueForFormIdMap.set(ele.__config__.formId + "-table-" + element.__config__.formId,
                element.__config__.defaultValue);
            });
          }
          else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
            let childrenObj = ele.__config__.childrenObj || {};
            let _arr = this.getValByTabs(childrenObj);
            _arr.map(item => {
              valueForFormIdMap.set(item.formId, item.defaultValue);
            });
          }
          else {
            valueForFormIdMap.set(ele.__config__.formId, this.formData[ele.__vModel__]);
          }
        });
        this.formConfig.fields.forEach((ele, index) => {
          if (ele.__config__.componentName == "table") {
            ele.__config__.children.forEach((element, childrenIndex) => {
              let defaultValue = 0;
              if (element.computationalConfiguration && element.computationalConfiguration.length > 0) {
                let formulaStr = "";
                element.computationalConfiguration.forEach((item) => {
                  if (item.type == "taxRate") {
                    //税率
                    if (element.taxRate >= 0) {
                      formulaStr += element.taxRate * 0.01;
                    }
                  }
                  else {
                    let eleValue = valueForFormIdMap.get(item.formId) || 0;
                    formulaStr += item.formId == 0 ? item.name : eleValue;
                  }
                });
                defaultValue = eval(formulaStr);
                defaultValue = this.getNumberFixed2(defaultValue);
                //大写
                if (element.isCapitalized) {
                  this.formConfig.fields[index].__config__.children[childrenIndex].__config__
                    .capitalizedValue = this.getCapitalizedMethod(defaultValue);
                }
                this.formConfig.fields[index].__config__.children[childrenIndex].__config__
                  .defaultValue = defaultValue;
                this.formData[element.__vModel__] = defaultValue;
              }
            });
          }
          else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
            let childrenObj = ele.__config__.childrenObj || {};
            //avue-tabs
            this.calcDefaultValueByTabs(ele.__config__.childrenObj, valueForFormIdMap);
          }
          else {
            let defaultValue = 0;
            if (ele.computationalConfiguration && ele.computationalConfiguration.length > 0) {
              let formulaStr = "";
              ele.computationalConfiguration.forEach((item) => {
                if (item.type == "taxRate") {
                  //税率
                  if (ele.taxRate >= 0) {
                    formulaStr += ele.taxRate * 0.01;
                  }
                }
                else {
                  let eleValue = valueForFormIdMap.get(item.formId) || 0;
                  formulaStr += item.formId == 0 ? item.name : eleValue;
                }
              });
              defaultValue = eval(formulaStr);
              defaultValue = this.getNumberFixed2(defaultValue);
              //大写
              if (ele.isCapitalized) {
                this.formConfig.fields[index].__config__.capitalizedValue = this.getCapitalizedMethod(
                  defaultValue);
              }
              this.formConfig.fields[index].__config__.defaultValue = defaultValue;
              this.formData[ele.__vModel__] = defaultValue;
            }
          }
        });
      },
      getValByTabs(childrenObj) {
        let _arr = [];
        if (!childrenObj || !(childrenObj instanceof Object)) return [];
        for (let key in childrenObj) {
          let children = childrenObj[key];
          children.map(item => {
            if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
              let cObj = item.__config__.childrenObj || {};
              _arr.push(...this.getValByTabs(item.__config__.childrenObj));
            }
            else {
              let _obj = {};
              _obj.formId = item.__config__.formId;
              _obj.defaultValue = this.formData[item.__vModel__];
              _arr.push(_obj);
            }
          });
        }
        return (() => {
          return _arr;
        })()
      },
      calcDefaultValueByTabs(childrenObj, valueForFormIdMap) {
        if (!childrenObj || !(childrenObj instanceof Object)) return;
        for (let key in childrenObj) {
          let children = childrenObj[key];
          children.map(item => {
            if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
              let cObj = item.__config__.childrenObj || {};
              this.calcDefaultValueByTabs(cObj, valueForFormIdMap);
            }
            else {
              let defaultValue = 0;
              if (item.computationalConfiguration && item.computationalConfiguration.length > 0) {
                let formulaStr = "";
                item.computationalConfiguration.forEach((c) => {
                  if (item.type == "taxRate") {
                    //税率
                    if (item.taxRate >= 0) {
                      formulaStr += item.taxRate * 0.01;
                    }
                  }
                  else {
                    let eleValue = valueForFormIdMap.get(c.formId) || 0;
                    formulaStr += c.formId == 0 ? c.name : eleValue;
                  }
                });
                defaultValue = eval(formulaStr);
                defaultValue = this.getNumberFixed2(defaultValue);
                item.__config__.defaultValue = defaultValue;
                this.formData[item.__vModel__] = defaultValue;
              }
            }
          });
        }
      },
      async getSelect_departOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/companies/departments/tree',
          });
          if (resp.data) {
            let {
              data
            } = resp.data
            this.select_departOptions = this.formatTree(data, 'F_DepartmentId', 'F_FullName', 'children', 1);
          }
        }
        catch (error) {}
      },
      async getChange_detailOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/bgmx/detail',
          });
          if (resp.data.data) {
            this.change_detailOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      async getIs_change_dataOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/YesOrNo/detail',
          });
          if (resp.data.data) {
            this.is_change_dataOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      //子表单权限
      getAuthorityTableChildrenList(bindTable, children) {
        let column = [];
        if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
          let formSubEnCodeList = this.formEnCodeList[bindTable];
          if (children && children.length > 0) {
            column = children.map(ele2 => {
              if (formSubEnCodeList.includes(ele2.prop)) {
                ele2.hide = false;
              }
              else {
                ele2.hide = true;
              }
              if (ele2.hide == false) {
                //工作流中系统表单必填权限
                if (this.formSubTableNotRequiredList[bindTable] != undefined) {
                  if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
                    ele2.required = false;
                  }
                  else {
                    ele2.required = true;
                  }
                }
                ele2.rules = [];
                if (ele2.required) {
                  ele2.rules = ele2.ruleList;
                }
                // disabled 属性
                if (this.formSubTableDisabledList[bindTable] != undefined) {
                  if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
                    ele2.disabled = true;
                  }
                  else {
                    ele2.disabled = false;
                  }
                }
              }
              return ele2;
            });
          }
          return column;
        }
        else {
          return children;
        }
      },
      getFormConfig() {
        let config = {
          "fields": [{
            "__vModel__": "field100726c",
            "__config__": {
              "label": "项目变更申请",
              "showLabel": false,
              "titleColor": null,
              "fontSize": null,
              "tag": "h2",
              "span": 24,
              "align": "top",
              "justify": "start",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 100
            }
          }, {
            "__vModel__": "current_user_id",
            "__type__": "info",
            "infoType": "user",
            "__organize__": true,
            "__config__": {
              "label": "当前用户",
              "showLabel": true,
              "tag": "avue-information-body",
              "avueType": "information-body",
              "defaultValue": "316231f32f1f0e5a4c56bf855806b924",
              "required": false,
              "span": 24,
              "whetherToRebindSecondaryEditing": false,
              "bindTableField": "current_user_id",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 101,
              "placeholder": "当前用户",
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "job",
            "__config__": {
              "label": "职级名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 102,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "job",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "role_id",
            "__config__": {
              "label": "角色ID",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 103,
              "fieldLength": 500,
              "bindTable": "oa_project_change",
              "bindTableField": "role_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "role_name",
            "__config__": {
              "label": "角色名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 104,
              "fieldLength": 500,
              "bindTable": "oa_project_change",
              "bindTableField": "role_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "area",
            "__config__": {
              "label": "地区",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 105,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "area",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "user_id",
            "__config__": {
              "label": "申请人ID",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 106,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "user_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "user_name",
            "__config__": {
              "label": "申请人名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 107,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "user_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "apply_time",
            "__type__": "info",
            "infoType": "date",
            "__organize__": true,
            "__config__": {
              "label": "申请时间",
              "showLabel": true,
              "tag": "avue-information-body",
              "avueType": "information-body",
              "defaultValue": "21db6a365d2f1254dac92f9ec314deaa",
              "required": false,
              "span": 24,
              "whetherToRebindSecondaryEditing": false,
              "bindTableField": "apply_time",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 108,
              "fieldLength": "100",
              "bindTable": "oa_project_change",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "depart_short_name",
            "__config__": {
              "label": "部门简称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 109,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "depart_short_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "depart_id",
            "__config__": {
              "label": "部门ID",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 110,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "depart_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "is_effective",
            "__config__": {
              "label": "是否生效",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "defaultValue": "0",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 111,
              "fieldLength": "10",
              "bindTable": "oa_project_change",
              "bindTableField": "is_effective",
              "bindTableFieldType": "int"
            }
          }, {
            "tempType": "tree",
            "__vModel__": "select_depart",
            "__type__": "department",
            "__organize__": true,
            "__config__": {
              "label": "变更发起部门",
              "showLabel": true,
              "required": false,
              "tag": "avue-input-tree",
              "dataKey": "data",
              "span": 24,
              "bindTableField": "select_depart",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 113,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "select_depart_des",
            "__config__": {
              "label": "其他说明",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "textarea",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 121,
              "fieldLength": "500",
              "bindTable": "oa_project_change",
              "bindTableField": "select_depart_des",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "input_depart",
            "__config__": {
              "label": "部门/中心名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 115,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "input_depart",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "project_technology_protocol",
            "__config__": {
              "label": "立项/技术方案",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 116,
              "fieldLength": "500",
              "bindTable": "oa_project_change",
              "bindTableField": "project_technology_protocol",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "change_detail",
            "__config__": {
              "label": "变更明细",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 117,
              "dataType": "dataItem",
              "dataItem": "bgmx",
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "change_detail",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "change_content",
            "__config__": {
              "label": "变更内容",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "textarea",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 122,
              "fieldLength": "1000",
              "bindTable": "oa_project_change",
              "bindTableField": "change_content",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "number",
            "__vModel__": "money_need",
            "computationalConfiguration": [],
            "append": "元",
            "__config__": {
              "label": "资金需求",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input",
              "defaultValue": "",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 123,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "money_need",
              "bindTableFieldType": "double"
            }
          }, {
            "tempType": "number",
            "__vModel__": "project_time",
            "computationalConfiguration": [],
            "append": "天",
            "__config__": {
              "label": "预计工期",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input",
              "defaultValue": "",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 124,
              "fieldLength": "50",
              "bindTable": "oa_project_change",
              "bindTableField": "project_time",
              "bindTableFieldType": "int"
            }
          }, {
            "__vModel__": "change_person_url",
            "__config__": {
              "label": "人员变更资料",
              "tag": "el-upload",
              "avueType": "upload",
              "defaultValue": null,
              "showLabel": true,
              "required": true,
              "span": 24,
              "showTip": false,
              "buttonText": "点击上传",
              "fileSize": 2,
              "sizeUnit": "MB",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 125,
              "fieldLength": "500",
              "bindTable": "oa_project_change",
              "bindTableField": "change_person_url",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "change_person_des",
            "__config__": {
              "label": "其他说明",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "textarea",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 126,
              "fieldLength": "100",
              "bindTable": "oa_project_change",
              "bindTableField": "change_person_des",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "is_change_data",
            "__config__": {
              "label": "变更资料",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 127,
              "fieldLength": "10",
              "bindTable": "oa_project_change",
              "bindTableField": "is_change_data",
              "bindTableFieldType": "varchar",
              "dataType": "dataItem",
              "dataItem": "YesOrNo"
            }
          }, {
            "__vModel__": "change_data_url",
            "__config__": {
              "label": "变更资料/附件",
              "tag": "el-upload",
              "avueType": "upload",
              "defaultValue": null,
              "showLabel": true,
              "required": true,
              "span": 24,
              "showTip": false,
              "buttonText": "点击上传",
              "fileSize": 2,
              "sizeUnit": "MB",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 128,
              "fieldLength": "500",
              "bindTable": "oa_project_change",
              "bindTableField": "change_data_url",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "field129bca1",
            "__config__": {
              "label": "分割线",
              "showLabel": false,
              "direction": "horizontal",
              "contentPosition": "",
              "tag": "el-divider",
              "top": 0,
              "bottom": 0,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 129
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "field130326e",
            "__type__": "opinion",
            "__config__": {
              "label": "意见簿",
              "showLabel": true,
              "tag": "xjr-opinion-comonent",
              "defaultValue": null,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 130
            }
          }]
        };
        return config;
      },
    }
}
</script>
<style>
.el-table__empty-block {
  width: 100% !important;
}

.avue-form__row {
  padding: 0 !important;
}

#editorphone {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #E4E7ED;
  padding: 0 7.5px;
  background: #f5f6fa;
  height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 5px;
}

#editorphone .el-col {
  border-bottom: 1px solid #F2F2F2;
  background: #fff;
  margin-bottom: 0;
  padding: 0 15px 6px !important;
  width: 100%;
}

#editorphone .el-form-item__label {
  line-height: 20px
}

#editorphone .el-input-group .el-input__inner {
  background: #f5f6fa
}

#editorphone .el-input__inner {
  border: 0
}

#editorphone .el-input-group__append,
#editorphone .el-input-group__prepend {
  border: 0;
  background: #edeef2;
  color: #666;
}

#editorphone .el-input-group .el-input__prefix {
  left: 44px
}

#editorphone .el-input-group .el-input__suffix {
  right: 44px
}

#editorphone .el-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: wrap;
}

#editorphone .el-form-item__label {
  float: none;
  min-width: 85px;
  width: auto !important;
  text-align: left;
  flex: auto;
}

#editorphone .tinymce .el-form-item__label {
  min-width: 100%;
}

#editorphone .el-form-item__content {
  margin-left: 0px !important;
  flex: auto;
  width: calc(100% - 95px);
}

#editorphone .avueFormNoLable .el-form-item__label,
#editorphone .avueFormNoLable .avue-crud__pagination {
  display: none;
}

#editorphone .avueFormNoLable .el-collapse-item__wrap,
#editorphone .avueFormNoLable .el-collapse {
  border-bottom: 0
}

#editorphone .avueFormNoLable .el-col {
  border-bottom: 0;
  padding-bottom: 0
}

#editorphone .el-form-item__content .el-button:first-child {
  margin-left: 90px;
}

.el-upload__tip {
  line-height: 1.2;
}

</style>
<style scoped>
  /* 关联审批单开始 */
  ::v-deep .el-dialog__footer{
    border-top: 1px solid #eee;
  }
  .height16{
    height: 16px;
  }
  .wrap{
    height: 400px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: row;
  }
  .wrap-items{
    width: 720px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: row;
  }
  .wrap-items-left{
    height: 100%;
    width: 10%;
  }
  .wrap-items-left-check{
    width: 100%;
    height: 40px;
    margin-top: 16px;
    text-align: center;
  }
  .adopt{
    width: 71px;
    height: 30px;
    background: #D8F8DD;
    border-radius: 3px;
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #10A300;
    line-height: 30px;
    text-align: center;
    margin: 0 auto;
  }
  .wrap-items-middle{
    height: 100%;
    width: 65%;
  }
  .wrap-items-right{
    height: 100%;
    width: 15%;
  }
  .wrap-items-left-adopt{
    margin-top: 16px;
  }
  .wrap-items-middle-title{
    margin-top: 16px;
    display: flex;
    flex-direction: row;
  }
  .first-name{
    width: 40px;
    height: 40px;
    background: #4371E4;
    border-radius: 4px;
    font-size: 16px;
    font-family: PingFang-SC-Bold, PingFang-SC;
    font-weight: 400;
    color: #FFFFFF;
    line-height: 40px;
    text-align: center;
  }
  .wrap-items-middle-title-content{
    font-size: 16px;
    font-family: PingFang-SC-Bold, PingFang-SC;
    font-weight: 400;
    color: #333333;
    line-height: 40px;
    margin-left: 16px;
  }
  .wrap-items-middle-type{
    display: flex;
    flex-direction: row;
  }
  .wrap-items-middle-type-left{
    width: 20%;
    height: 100%;
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #999999;
  }
  .wrap-items-middle-type-right{
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #555555;
  }
  .overflow{
    height: 400px;
    overflow: scroll;
  }
  .del_items{
    width: 350px;
    height: 32px;
    margin-top: 4px;
    background: rgb(246, 246, 246);
    border-radius: 4px;
    display: flex;
    flex-direction: row;

  }
  .del-items-left{
    width: 32px;
    height: 32px;
    text-align: center;
  }
  
  .del-items-left > img{
    width: 22px;
    height: 22px;
    margin-top: 5px;
  }
  .del-items-middle{
    width: 180px;
    height: 32px;
    font-size: 16px;
    font-weight: 400;
    text-align: left;
    line-height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .del-items-processing{
     width: 80px;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    line-height: 32px;
    color: #FE8B04;
  }
  .del-items-refuse{
     width: 80px;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    line-height: 32px;
    color: #FD513B;
  }
  .del-items-adopt{
     width: 80px;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    line-height: 32px;
    color: #10A300;
  }
  .del-items-right{
    width: 90px;
    height: 32px;
  }
  .del-items-close{
    width: 32px;
    height: 32px;
    margin-left: 24px;
  }
.del-items-close > img{
    width: 16px;
    height: 16px;
  }


  .search-box{
    width: 100%;
    height: 32px;
    margin: 8px 0;
    display: flex;
    flex-direction: row;
  }
  .search-box-left{
    width: 50%;
    height: 32px;
    text-align: center;
  }
  .search-box-left-input{
    width: 300px;
  }
  .search-box-right{
    width: 50%;
    height: 32px;
    text-align: center;
  }
  .el-paganation{
    width: 100%;
    height: 40px;
    text-align: center;
  }
  .el-paganation-i{
    margin-top: 16px;
  }
</style>